<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <script src="./filters/formatDate.js"></script>

</head>
<body>
    <div id="app">
        <input type="text" v-model="msg">
        <p>计算属性:{{ getMsg }}</p>
        <p>计算属性:{{ getMsg }}</p>
        <p>计算属性:{{ getMsg }}</p>
        <p>计算属性:{{ getMsg }}</p>
        <p>计算属性:{{ getMsg }}</p>

        <p>过滤器:{{ msg | loadMsg }}</p>
        <p>过滤器:{{ msg | loadMsg() }}</p>
        <p>过滤器:{{ msg | loadMsg }}</p>
        <p>过滤器:{{ msg | loadMsg }}</p>
        <p>过滤器:{{ msg | loadMsg }}</p>


    </div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            msg:"依赖变量"
        },
        computed: {
            getMsg(){
                console.log("计算属性");
                return this.msg + Math.random();
            }
        },
        filters:{
            loadMsg(target){
                console.log("过滤器");
                return target + Math.random();
            }
        }
    })
</script>
</html>